package www.com.guigu.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.*;
import www.com.guigu.pojo.Login;
import www.com.guigu.service.Loginservice;

import javax.servlet.http.HttpSession;
import java.util.UUID;

@Controller
public class Usercontroller {
    @Autowired
    private Loginservice loginservice;
    @RequestMapping("ss")
    public String login(HttpSession session,String zh, String mm){
        Login login=loginservice.login(zh,mm);
        if(login!=null){
            session.setAttribute("user",zh);
            return "redirect:aa";
        }
        return "../index";
    }
    @GetMapping("aa")
    public String gethome(){
        return "home/home";
    }
    @PostMapping("")
    public String file(){
       String s= UUID.randomUUID().toString();
        return null;
    }
}
